home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / g_man / cat3 / OpenGL-ftn / fglmap1.z / fglmap1
Encoding:
Text File  |  2002-10-03  |  18.9 KB  |  281 lines

  1.  
  2.  
  3.  
  4. ffffggggllllMMMMaaaapppp1111((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ffffggggllllMMMMaaaapppp1111((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ffffggggllllMMMMaaaapppp1111dddd,,,, ffffggggllllMMMMaaaapppp1111ffff - define a one-dimensional evaluator
  10.  
  11.  
  12. FFFFOOOORRRRTTTTRRRRAAAANNNN SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  13.      SUBROUTINE ffffggggllllMMMMaaaapppp1111dddd( INTEGER*4 _t_a_r_g_e_t,
  14.                           REAL*4 _u_1,
  15.                           REAL*4 _u_2,
  16.                           INTEGER*4 _s_t_r_i_d_e,
  17.                           INTEGER*4 _o_r_d_e_r,
  18.                           CHARACTER*8 _p_o_i_n_t_s )
  19.      SUBROUTINE ffffggggllllMMMMaaaapppp1111ffff( INTEGER*4 _t_a_r_g_e_t,
  20.                           REAL*4 _u_1,
  21.                           REAL*4 _u_2,
  22.                           INTEGER*4 _s_t_r_i_d_e,
  23.                           INTEGER*4 _o_r_d_e_r,
  24.                           CHARACTER*8 _p_o_i_n_t_s )
  25.  
  26.  
  27. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  28.      _t_a_r_g_e_t  Specifies the kind of values that are generated by the evaluator.
  29.              Symbolic constants GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____3333, GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____4444,
  30.              GGGGLLLL____MMMMAAAAPPPP1111____IIIINNNNDDDDEEEEXXXX, GGGGLLLL____MMMMAAAAPPPP1111____CCCCOOOOLLLLOOOORRRR____4444, GGGGLLLL____MMMMAAAAPPPP1111____NNNNOOOORRRRMMMMAAAALLLL,
  31.              GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____1111, GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____2222,
  32.              GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____3333, and GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____4444 are
  33.              accepted.
  34.  
  35.      _u_1, _u_2  Specify a linear mapping of u, as presented to ffffggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd1111, to
  36.              u^, the variable that is evaluated by the equations specified by
  37.              this command.
  38.  
  39.      _s_t_r_i_d_e  Specifies the number of floats or doubles between the beginning
  40.              of one control point and the beginning of the next one in the
  41.              data structure referenced in _p_o_i_n_t_s.  This allows control points
  42.              to be embedded in arbitrary data structures.  The only constraint
  43.              is that the values for a particular control point must occupy
  44.              contiguous memory locations.
  45.  
  46.      _o_r_d_e_r   Specifies the number of control points.  Must be positive.
  47.  
  48.      _p_o_i_n_t_s  Specifies a pointer to the array of control points.
  49.  
  50.  
  51. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  52.      Evaluators provide a way to use polynomial or rational polynomial mapping
  53.      to produce vertices, normals, texture coordinates, and colors.  The
  54.      values produced by an evaluator are sent to further stages of GL
  55.      processing just as if they had been presented using ffffggggllllVVVVeeeerrrrtttteeeexxxx, ffffggggllllNNNNoooorrrrmmmmaaaallll,
  56.      ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd, and ffffggggllllCCCCoooolllloooorrrr commands, except that the generated values do
  57.      not update the current normal, texture coordinates, or color.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ffffggggllllMMMMaaaapppp1111((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ffffggggllllMMMMaaaapppp1111((((3333GGGG))))
  71.  
  72.  
  73.  
  74.      All polynomial or rational polynomial splines of any degree (up to the
  75.      maximum degree supported by the GL implementation) can be described using
  76.      evaluators.  These include almost all splines used in computer graphics:
  77.      B-splines, Bezier curves, Hermite splines, and so on.
  78.  
  79.      Evaluators define curves based on Bernstein polynomials.  Define p(u^) as
  80.  
  81.                                              n
  82.  
  83.                                             R   n
  84.                                 p(u^)  =       B (u^)R
  85.                                          i=0   i    i
  86.  
  87.                                        n
  88.      where R  is a control point and B (u^) is the ith Bernstein polynomial of
  89.             i                         i
  90.      degree n (_o_r_d_e_r = n + 1):
  91.  
  92.                                        (    )
  93.                                n          n    i     n-i
  94.                              B (u^)  =  |    | u^ (1-u^)
  95.                               i
  96.                                        (i  )
  97.  
  98.  
  99.      Recall that
  100.  
  101.                                          (     )
  102.                                0            n
  103.                               0  _= 1 and |     |   _=  1
  104.  
  105.                                          ( 0  )
  106.  
  107.  
  108.      ffffggggllllMMMMaaaapppp1111 is used to define the basis and to specify what kind of values
  109.      are produced.  Once defined, a map can be enabled and disabled by calling
  110.      ffffggggllllEEEEnnnnaaaabbbblllleeee and ffffggggllllDDDDiiiissssaaaabbbblllleeee with the map name, one of the nine predefined
  111.      values for _t_a_r_g_e_t described below.  ffffggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd1111 evaluates the one-
  112.      dimensional maps that are enabled.  When ffffggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd1111 presents a value
  113.      u, the Bernstein functions are evaluated using u^, where
  114.  
  115.                                                 u - u1_______
  116.                                    u^  =
  117.                                          u2 - u1
  118.  
  119.  
  120.  
  121.      _t_a_r_g_e_t is a symbolic constant that indicates what kind of control points
  122.      are provided in _p_o_i_n_t_s, and what output is generated when the map is
  123.      evaluated.  It can assume one of nine predefined values:
  124.  
  125.      GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____3333         Each control point is three floating-point
  126.                               values representing x, y, and z.  Internal
  127.                               ffffggggllllVVVVeeeerrrrtttteeeexxxx3333 commands are generated when the map
  128.                               is evaluated.
  129.  
  130.      GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____4444         Each control point is four floating-point values
  131.                               representing x, y, z, and w.  Internal
  132.                               ffffggggllllVVVVeeeerrrrtttteeeexxxx4444 commands are generated when the map
  133.                               is evaluated.
  134.  
  135.      GGGGLLLL____MMMMAAAAPPPP1111____IIIINNNNDDDDEEEEXXXX            Each control point is a single floating-point
  136.                               value representing a color index.  Internal
  137.                               ffffggggllllIIIInnnnddddeeeexxxx commands are generated when the map is
  138.                               evaluated but the current index is not updated
  139.                               with the value of these ffffggggllllIIIInnnnddddeeeexxxx commands.
  140.  
  141.  
  142.  
  143.  
  144.  
  145.                                                                         PPPPaaaaggggeeee 2222
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152. ffffggggllllMMMMaaaapppp1111((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ffffggggllllMMMMaaaapppp1111((((3333GGGG))))
  153.  
  154.  
  155.  
  156.      GGGGLLLL____MMMMAAAAPPPP1111____CCCCOOOOLLLLOOOORRRR____4444          Each control point is four floating-point values
  157.                               representing red, green, blue, and alpha.
  158.                               Internal ffffggggllllCCCCoooolllloooorrrr4444 commands are generated when
  159.                               the map is evaluated but the current color is
  160.                               not updated with the value of these ffffggggllllCCCCoooolllloooorrrr4444
  161.                               commands.
  162.  
  163.      GGGGLLLL____MMMMAAAAPPPP1111____NNNNOOOORRRRMMMMAAAALLLL           Each control point is three floating-point
  164.                               values representing the x, y, and z components
  165.                               of a normal vector.  Internal ffffggggllllNNNNoooorrrrmmmmaaaallll commands
  166.                               are generated when the map is evaluated but the
  167.                               current normal is not updated with the value of
  168.                               these ffffggggllllNNNNoooorrrrmmmmaaaallll commands.
  169.  
  170.      GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____1111  Each control point is a single floating-point
  171.                               value representing the s texture coordinate.
  172.                               Internal ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd1111 commands are generated
  173.                               when the map is evaluated but the current
  174.                               texture coordinates are not updated with the
  175.                               value of these ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  176.  
  177.      GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____2222  Each control point is two floating-point values
  178.                               representing the s and t texture coordinates.
  179.                               Internal ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd2222 commands are generated
  180.                               when the map is evaluated but the current
  181.                               texture coordinates are not updated with the
  182.                               value of these ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  183.  
  184.      GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____3333  Each control point is three floating-point
  185.                               values representing the s, t, and r texture
  186.                               coordinates.  Internal ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd3333 commands are
  187.                               generated when the map is evaluated but the
  188.                               current texture coordinates are not updated with
  189.                               the value of these ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  190.  
  191.      GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____4444  Each control point is four floating-point values
  192.                               representing the s, t, r, and q texture
  193.                               coordinates.  Internal ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd4444 commands are
  194.                               generated when the map is evaluated but the
  195.                               current texture coordinates are not updated with
  196.                               the value of these ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  197.  
  198.      _s_t_r_i_d_e, _o_r_d_e_r, and _p_o_i_n_t_s define the array addressing for accessing the
  199.      control points.  _p_o_i_n_t_s is the location of the first control point, which
  200.      occupies one, two, three, or four contiguous memory locations, depending
  201.      on which map is being defined.  _o_r_d_e_r is the number of control points in
  202.      the array.  _s_t_r_i_d_e specifies how many float or double locations to
  203.      advance the internal memory pointer to reach the next control point.
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.                                                                         PPPPaaaaggggeeee 3333
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218. ffffggggllllMMMMaaaapppp1111((((3333GGGG))))                    OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                    ffffggggllllMMMMaaaapppp1111((((3333GGGG))))
  219.  
  220.  
  221.  
  222. NOTES
  223.      As is the case with all GL commands that accept pointers to data, it is
  224.      as if the contents of _p_o_i_n_t_s were copied by ffffggggllllMMMMaaaapppp1111 before ffffggggllllMMMMaaaapppp1111
  225.      returns.  Changes to the contents of _p_o_i_n_t_s have no effect after ffffggggllllMMMMaaaapppp1111
  226.      is called.
  227.  
  228. EEEERRRRRRRROOOORRRRSSSS
  229.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEENNNNUUUUMMMM is generated if _t_a_r_g_e_t is not an accepted value.
  230.  
  231.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if _u_1 is equal to _u_2.
  232.  
  233.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if _s_t_r_i_d_e is less than the number of values
  234.      in a control point.
  235.  
  236.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if _o_r_d_e_r is less than 1 or greater than the
  237.      return value of GGGGLLLL____MMMMAAAAXXXX____EEEEVVVVAAAALLLL____OOOORRRRDDDDEEEERRRR.
  238.  
  239.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____OOOOPPPPEEEERRRRAAAATTTTIIIIOOOONNNN is generated if ffffggggllllMMMMaaaapppp1111 is executed between the
  240.      execution of ffffggggllllBBBBeeeeggggiiiinnnn and the corresponding execution of ffffggggllllEEEEnnnndddd.
  241.  
  242. AAAASSSSSSSSOOOOCCCCIIIIAAAATTTTEEEEDDDD GGGGEEEETTTTSSSS
  243.      ffffggggllllGGGGeeeettttMMMMaaaapppp
  244.      ffffggggllllGGGGeeeetttt with argument GGGGLLLL____MMMMAAAAXXXX____EEEEVVVVAAAALLLL____OOOORRRRDDDDEEEERRRR
  245.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____3333
  246.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____VVVVEEEERRRRTTTTEEEEXXXX____4444
  247.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____IIIINNNNDDDDEEEEXXXX
  248.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____CCCCOOOOLLLLOOOORRRR____4444
  249.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____NNNNOOOORRRRMMMMAAAALLLL
  250.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____1111
  251.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____2222
  252.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____3333
  253.      ffffggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP1111____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____4444
  254.  
  255.  
  256. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  257.      ffffggggllllBBBBeeeeggggiiiinnnn, ffffggggllllCCCCoooolllloooorrrr, ffffggggllllEEEEnnnnaaaabbbblllleeee, ffffggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd, ffffggggllllEEEEvvvvaaaallllMMMMeeeesssshhhh, ffffggggllllEEEEvvvvaaaallllPPPPooooiiiinnnntttt,
  258.      ffffggggllllMMMMaaaapppp2222, ffffggggllllMMMMaaaappppGGGGrrrriiiidddd, ffffggggllllNNNNoooorrrrmmmmaaaallll, ffffggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd, ffffggggllllVVVVeeeerrrrtttteeeexxxx
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.                                                                         PPPPaaaaggggeeee 4444
  278.  
  279.  
  280.  
  281.